Skip to content

Clarify run-sql's release resolution and Skill guidance (citation, truncation) - #3

Merged
jdhayhurst merged 2 commits into
mainfrom
clarify-run-sql-release-resolution
Jul 10, 2026
Merged

Clarify run-sql's release resolution and Skill guidance (citation, truncation)#3
jdhayhurst merged 2 commits into
mainfrom
clarify-run-sql-release-resolution

Conversation

@project-defiant

@project-defiant project-defiant commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Summary

Two rounds of Skill guidance clarifications, based on real testing:

  1. Release resolutionrun-sql has no --release flag at all (unlike list-datasets/describe-dataset), and release selection happens by scanning the query text for schema qualifiers, not via a CLI argument — each qualifier (e.g. "26.06") is read directly as a release identifier and lazily built if needed. A single call can span any number of releases just by naming them in the SQL.

  2. SQL query citation — the existing "cite your sources" rule already asked for the SQL to be shown, but was ambiguous about when (didn't say "at the end") and about multi-query turns (didn't say "every query, not just the last one"). Tightened the existing rule rather than adding a duplicate.

  3. Truncation handling, new — nothing previously told the agent to check data.truncated on a successful run-sql response. A capped result (~1000 rows) is still ok: true, so without this an agent could silently present a partial result as if it were complete. Added guidance to prefer aggregating (COUNT, GROUP BY, TOP N) over paginating by default, with LIMIT/OFFSET pagination as an explicit fallback when the user genuinely needs row-level detail beyond 1000 rows.

Docs-only change, no code changes.

Test plan

  • prek run --files .claude/skills/otai/SKILL.md passes

SzymonSzyszkowski and others added 2 commits July 10, 2026 09:03
Testing showed the Skill's guidance wasn't clear enough: run-sql has
no --release flag at all (unlike list-datasets/describe-dataset), and
release selection happens by scanning the query text for schema
qualifiers, not via a CLI argument - each qualifier (e.g. "26.06") is
read directly as a release identifier and lazily built if needed. A
single call can therefore span any number of releases just by naming
them in the SQL, with no separate flag or "compare releases" step.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Rule 6 ("cite your sources") already covered showing the SQL, but was
ambiguous about *when* (didn't say "at the end") and about multi-query
turns (didn't say "every query, not just the last"). Tightened it
rather than adding a duplicate rule.

Added rule 7: nothing previously told the agent to check
data.truncated on a *successful* run-sql response - a capped result is
still ok:true, so without this an agent could silently present a
partial (first-1000-rows) result as if it were complete. Recommends
aggregating over paginating as the default strategy, with LIMIT/OFFSET
pagination as a fallback for genuine row-level-detail needs.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@project-defiant project-defiant changed the title Clarify run-sql's release resolution in SKILL.md Clarify run-sql's release resolution and Skill guidance (citation, truncation) Jul 10, 2026
@jdhayhurst
jdhayhurst merged commit 8a7c085 into main Jul 10, 2026
2 checks passed
@project-defiant
project-defiant deleted the clarify-run-sql-release-resolution branch July 10, 2026 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants